package com.nongda.mapper;

import com.github.pagehelper.Page;
import com.nongda.dto.ShangPinDto;
import com.nongda.dto.ShangPinPageDto;
import com.nongda.pojo.ShangPin;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ShangPinMapper {
    @Insert("insert into shangpin (id, name, size, price,create_time,create_city,eat_before) VALUE " +
            "(#{id},#{name},#{size},#{price},#{createTime},#{createCity},#{eatBefore})")
    void tianjia(ShangPin shangPin);


    void xiugai(ShangPin shangPin);

    @Delete("delete from shangpin where id=#{id}")
    void shanchu(Integer id);

    Page<ShangPin> chaxun(ShangPinPageDto shangPinPageDto);
}
